boot: Add fit_config_get_hash_list() to build signed node list
authorSimon Glass <simon.glass@canonical.com>
Fri, 6 Mar 2026 01:20:09 +0000 (18:20 -0700)
committerAndreas Henriksson <andreas@fatal.se>
Tue, 23 Jun 2026 19:07:40 +0000 (21:07 +0200)
commitb9386d23026670e49d518dfa6e3bdce316ce9497
tree706664eef0351daa32d7356ebc2caa35c59cb7e0
parentb2916ce898af0e2a629829d4e7ffd9a25133530f
boot: Add fit_config_get_hash_list() to build signed node list

The hashed-nodes property in a FIT signature node lists which FDT paths
are included in the signature hash. It is intended as a hint so should
not be used for verification.

Add a function to build the node list from scratch by iterating the
configuration's image references. Skip properties known not to be image
references. For each image, collect the path plus all hash and cipher
subnodes.

Use the new function in fit_config_check_sig() instead of reading
'hashed-nodes'.

Update the test_vboot kernel@ test case: fit_check_sign now catches the
attack at signature-verification time (the @-suffixed node is hashed
instead of the real one, causing a mismatch) rather than at
fit_check_format() time.

Update the docs to cover this. The FIT spec can be updated separately.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
Closes: https://lore.kernel.org/u-boot/20260302220937.3682128-1-trini@konsulko.com/
Reported-by: Apple Security Engineering and Architecture (SEAR)
Tested-by: Tom Rini <trini@konsulko.com>
(cherry picked from commit 2092322b31cc8b1f8c9e2e238d1043ae0637b241)

Gbp-Pq: Name CVE-2026-46728-2.patch
common/image-fit-sig.c